<?php
/**
 * Created by IntelliJ IDEA.
 * User: 34984
 * Date: 2017/3/23
 * Time: 10:44
 */


//params
$id       = $_GET['id'];

//DB config,DO NOT USE DEFINE,$result always callback 1
$DB_HOST = '182.254.219.244:3306';
$DB_USER = 'mldb';
$DB_PASS = 'mldbtest';
$DB_DATABASENAME = 'mldb';
$DB_TABLENAME = 'ComputerBuy';
//mysql_connect
$conn = mysql_connect($DB_HOST, $DB_USER, $DB_PASS) or die("connect failed" . mysql_error());
mysql_select_db($DB_DATABASENAME, $conn);


//delete row in db
$sql = sprintf("delete from %s where id=%d", $DB_TABLENAME, $id);
//echo "<script>alert($sql)</script>";
$result = mysql_query($sql, $conn);
mysql_close($conn);
if ($result)
    echo "t";
else
    echo "f";
?>